import Vue from 'vue'
import VueRouter from 'vue-router'
import layout from '@/views/layout/Index'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    component:layout,
    children:[
      {
        path:'/',
        name:'HomeIndex',
        component:()=>import('@/views/home/Index')
      }
    ]
  },
  {
    path: '/businessPage',
    name:'BusinessPage',
    component:()=>import('@/views/home/BusinessPage')
  },
  {
    path:'/orderPay',
    name:'OrderPay',
    component: ()=>import('@/views/home/PayPage')
  },
  {
    path: '/order',
    component: layout,
    children: [
      {
        path:'/',
        name:'OrderIndex',
        component:()=>import('@/views/order/Index')
      }
    ]
  },
  {
    path: '/order/details',
    name:'OrderDetails',
    component: ()=>import('@/views/order/OrderDetails')
  },
  {
    path: '/my',
    component:layout,
    children: [
      {
        path:'/',
        name:'MyIndex',
        component:()=>import('@/views/my/Index')
      }
    ]
  },
  {
    path:'/my/address',
    name:'MyAddress',
    component: ()=>import('@/views/my/Address')
  },
  {
    path:'/my/info',
    name:'MyInfo',
    component: ()=>import('@/views/my/Info')
  },
  {
    path:'/login',
    name:'Login',
    component: ()=>import('@/views/login/Index')
  }
]

const router = new VueRouter({
  base:'qydc-admin',
  routes,
  mode:"history"
})

export default router
